<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>考核信息编辑</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layuimini-2/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="/layuimini-2/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<div class="layui-form layuimini-form">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label required">员工姓名</label>
        <div class="layui-input-block">
            <input type="text" name="emplId" lay-verify="required" lay-reqtext="员工不能为空" placeholder="请输入员工姓名" value="" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">迟到次数</label>
        <div class="layui-input-inline">
            <input type="text" name="daysLate" value="" class="layui-input" style="width: 40px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">早退次数</label>
        <div class="layui-input-inline">
            <input type="text" name="leaveEarly" value="" class="layui-input" style="width: 40px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">旷工</label>
        <div class="layui-input-inline">
            <input type="text" name="absent" value="" class="layui-input" style="width: 40px">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label required">奖励/表扬</label>
        <div class="layui-input-block">
            <input type="text" name="reward" value="" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
        </div>
    </div>
</div>
<script src="/layuimini-2/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script>
    layui.use(['form'], function () {
        var form = layui.form,
            layer = layui.layer,
            $ = layui.$;

        //监听提交
        form.on('submit(saveBtn)', function (data) {
            $.ajax({
                url:"/exam/edit.do",
                type:"post",
                data:data.field,
                success:function (ret) {
                    if (ret.code == 0) {
                        var index = layer.alert("修改成功",function () {
                            // 关闭弹出层
                            layer.close(index);
                            var iframeIndex = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(iframeIndex);
                        });
                    } else {
                        layer.msg("添加失败!!!");
                    }
                },
                error: function () {
                    layer.msg("服务器繁忙!!!");
                }
            })
            return false;
        });

    });
</script>
</body>
</html>